﻿using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Options;

namespace VOL.RabbitMq.RabbitMq
{
    /// <summary>
    /// 基础消息处理器
    /// </summary>
    public abstract class BaseHandler
    {
        #region 变量

        /// <summary>
        /// 实例化提供者
        /// </summary>
        protected internal readonly IServiceProvider mServiceProvider;
        /// <summary>
        /// 控制器选项列表
        /// </summary>
        protected internal readonly List<HandlerDto> mHandlerOptions;

        #endregion

        #region 属性

        /// <summary>
        /// 描述
        /// </summary>
        public abstract String Description { get; }

        #endregion

        #region 构造函数

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="serviceProvider">实例化提供者</param>
        public BaseHandler(IServiceProvider serviceProvider)
        {
            mServiceProvider = serviceProvider;

            mHandlerOptions = serviceProvider.GetRequiredService<IOptions<RabbitMqModel>>().Value.RabbitMqHandler;
        }

        #endregion

        #region 方法



        #endregion
    }
}
